package com.system.vote.admin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.system.vote.common.utils.CustomDateTimeSerializer;
import lombok.Data;

/**
 * 登录日志表
 * @TableName sys_login_log
 */
@TableName(value ="sys_login_log")
@Data
public class SysLoginLog implements Serializable {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 登陆人姓名
     */
    @TableField(value = "name")
    private String name;

    /**
     * 登录ip
     */
    @TableField(value = "ip")
    private String ip;

    /**
     * ip归属地信息
     */
    @TableField(value = "ip_attribution")
    private String ipAttribution;

    /**
     * 创建时间
     */
    @JsonSerialize(using = CustomDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 登录人ID
     */
    @TableField(value = "uid")
    private Long uid;

    /**
     * 登录人设备
     */
    @TableField(value = "type")
    private Integer type;

    /**
     * 用户代理
     */
    @TableField(value = "user_agent")
    private String userAgent;

    /**
     * 设备名称
     */
    @TableField(value = "device_name")
    private String deviceName;

    /**
     * 浏览器
     */
    @TableField(value = "browser_name")
    private String browserName;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}